package com.example.crossborderecommerce.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 客户订单
 *
 * @author Yolanda
 * @since 2024-05-09
 */
@Data
@Accessors(chain = true)
@TableName("customer_order")
public class CustomerOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField("status")
    private String status;

    @TableField("store_commodity_id")
    private Integer storeCommodityId;

    @TableField(exist = false)
    private Integer productId;

    @TableField(exist = false)
    private Integer storeId;

    @TableField(exist = false)
    private String storeName;

    @TableField(exist = false)
    private String productName;

    @TableField("quantity")
    private Integer quantity;

    @TableField("price")
    private Double price;

    @TableField("currency_id")
    private String currencyId;

    @TableField(exist = false)
    private String currency;

    @TableField("shop_id")
    private Integer shopId;

    @TableField(exist = false)
    private String shopName;

    @TableField("logistics_provider_id")
    private Integer logisticsProviderId;

    @TableField(exist = false)
    private String logisticsProviderName;

    @TableField("customer_id")
    private Integer customerId;

    @TableField(exist = false)
    private String customerName;

    @TableField("customer_address")
    private String customerAddress;

    @TableField(exist = false)
    private String customerNation;

    @TableField("customer_phone")
    private String customerPhone;

    @TableField("sale_promotion_id")
    private Integer salePromotionId;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") //指定格式
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") //指定格式
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private String salePromotionName;
}
